package edu.sctu.practice.class02.shuqiqi.text19;

/**
 * Created by admin on 2015/11/2.
 */
public class Circle extends Graph1 {
    double pi = 3.14;
    int radius = 2;

    public Circle(String color) {
        super("白色");
        System.out.println("圆" + "\n颜色：" + color + "\n半径：" + radius);
    }

    public double getArea() {
        double area = pi * radius * radius;
        System.out.println("面积：" + area);
        return area;
    }

    public double getPerimeter() {
        double perimeter = 2 * pi * radius;
        System.out.println("周长：" + perimeter);
        return perimeter;
    }
}
